Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

作业2-12-Cloud #30

Merged
merged 5 commits into from
Apr 10, 2017
Merged

作业2-12-Cloud #30

merged 5 commits into from
Apr 10, 2017

Conversation

cloud0606
Copy link
Contributor

没有随机生成数字在构建单链表

#define length 10
typedef struct LNode{
int data;
LNode *next ;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

仅接受C语言版的代码实现,不接受C++代码
建议使用后缀名.c去调试无误后再行提交

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请问还有需要修改的部分吗~~结构体部分c++代码已经改正了。

scanf("%d",& p->data );
p->next = L->next ;//��һ�����ʱL->next����һ�β���Ľڵ������������󡣣�
L->next = p;//�����һ������ɵĽ�����ȥ��
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意代码格式化,建议使用VS自动格式化代码

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

//}

}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用随机函数产生链表数据,不要手工输入

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已改

printf("�������:");
LinkList p = L_->next ;
for(int i = 0 ;i <length;i++){
//printf("%d ",(L_+i)->data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

循环结束条件设置有误,请重新考虑链表遍历方法

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已改

CreatList(list_a,length);
CreatList(list_b,length);
MergeList(list_a,list_b,list_c);
travle(list_c);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意缩进和代码格式化

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Copy link
Collaborator

@cucyoyo cucyoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码整体没有问题,再修改一些细节问题就可以了。

return ERROR;
}
break;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该加入default语句

if(ch != EOF){
ch = getchar();
}//��β���ʹch == EOF?
DestroyStack(&_s);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

销毁栈应该放到大的while循环外面,否则会使得程序第二次输入字符串时报错终止。

Copy link
Collaborator

@cucyoyo cucyoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

经过修改之后没有问题,可以通过。

@c4pr1c3 c4pr1c3 merged commit 1149aca into CUCCS:master Apr 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants